ci: add CI workflows, golangci-lint config, and release pipeline#2
Conversation
WalkthroughThis PR adds CI/CD workflows (Tests and Release), updates go.mod dependency versions, adjusts golangci-lint config, and reformats an example import line. ChangesCI/CD Infrastructure and Dependency Updates
🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5660e90bb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds Go lint/format and test automation plus a Docker image release workflow, aligned with the repo’s Nix-based dev environment.
Changes:
- Add
.golangci.yml(v2) enabling standard linters +modernizeandgofumptformatting. - Add GitHub Actions workflow for lint/format checks and unit tests via
nix develop. - Add GitHub Actions release workflow to build and push multi-arch images to Docker Hub and Huawei SWR on
v*tags.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
go.mod |
Updates Go dependencies (notably Fiber/MinIO/slog-fiber) and removes several previously-required modules. |
go.sum |
Updates module checksums in line with dependency changes. |
flake.lock |
Updates pinned nixpkgs revision for the Nix flake environment. |
.golangci.yml |
Introduces golangci-lint v2 config with modernize + gofumpt. |
.github/workflows/tests.yml |
Adds Nix-based lint/format and go test ./... CI on PRs and main. |
.github/workflows/release.yml |
Adds PR build validation and tag-based image publishing pipeline using docker buildx bake. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
.github/workflows/release.yml (1)
16-16: ⚡ Quick winVerify the runner label resolution.
On Line 16,
blacksmith-2vcpu-ubuntu-2404-armis not recognized by standard actionlint labels. If this is intentional custom infra, add the corresponding actionlint config; otherwise switch to a supported ARM label.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/release.yml at line 16, The runner label "blacksmith-2vcpu-ubuntu-2404-arm" used in the workflow is not recognized by actionlint; either register this custom label in your actionlint configuration or replace it with a supported ARM runner label (e.g., a standard GitHub-hosted ARM label or "self-hosted" group) to ensure actionlint passes; update the workflow to use the new label or add the custom mapping so the label resolution for "blacksmith-2vcpu-ubuntu-2404-arm" is valid..github/workflows/tests.yml (1)
21-21: ⚡ Quick winVerify runner label is intentionally custom in both jobs.
On Lines 21 and 41,
blacksmith-2vcpu-ubuntu-2404-armmay fail validation unless your runner ecosystem/actionlint config explicitly supports it.Also applies to: 41-41
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/tests.yml at line 21, The workflow uses a nonstandard runner label 'blacksmith-2vcpu-ubuntu-2404-arm' in the runs-on key (appearing twice); verify that this exact label is registered in your self-hosted runner pool or supported by your actionlint/config, otherwise replace both occurrences with a valid runner label (e.g., a registered self-hosted label or a standard GitHub runner like 'ubuntu-24.04'/'ubuntu-latest') or document the custom label in your CI setup so validation and other jobs won’t fail.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/release.yml:
- Around line 28-42: The steps "Login to Docker Hub" and "Login to Huawei SWR"
currently gate on the expression github.event_name != 'pull_request', which
still allows workflow_dispatch and can publish non-version tags; change the
conditional so these steps only run for version-tag pushes—for example require
github.event_name == 'push' and that github.ref is a tag (use
startsWith(github.ref, 'refs/tags/') or github.ref_type == 'tag') so the
login/publish logic in this workflow only executes for tag pushes (affecting the
steps named "Login to Docker Hub" and "Login to Huawei SWR" and any subsequent
publish steps that rely on GITHUB_REF_NAME).
---
Nitpick comments:
In @.github/workflows/release.yml:
- Line 16: The runner label "blacksmith-2vcpu-ubuntu-2404-arm" used in the
workflow is not recognized by actionlint; either register this custom label in
your actionlint configuration or replace it with a supported ARM runner label
(e.g., a standard GitHub-hosted ARM label or "self-hosted" group) to ensure
actionlint passes; update the workflow to use the new label or add the custom
mapping so the label resolution for "blacksmith-2vcpu-ubuntu-2404-arm" is valid.
In @.github/workflows/tests.yml:
- Line 21: The workflow uses a nonstandard runner label
'blacksmith-2vcpu-ubuntu-2404-arm' in the runs-on key (appearing twice); verify
that this exact label is registered in your self-hosted runner pool or supported
by your actionlint/config, otherwise replace both occurrences with a valid
runner label (e.g., a registered self-hosted label or a standard GitHub runner
like 'ubuntu-24.04'/'ubuntu-latest') or document the custom label in your CI
setup so validation and other jobs won’t fail.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9e96178e-f16a-4815-bd79-84eef754501a
⛔ Files ignored due to path filters (2)
flake.lockis excluded by!**/*.lockgo.sumis excluded by!**/*.sum
📒 Files selected for processing (4)
.github/workflows/release.yml.github/workflows/tests.yml.golangci.ymlgo.mod
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52389b2c0f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
562c2b1 to
45a771c
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.github/workflows/release.yml (2)
52-53: 💤 Low valueConsider adding explicit cache scope for consistency with arm64 job.
The arm64 build uses an explicit
scope=buildkit-linux-arm64for cache isolation, but amd64 relies on the default scope. While this works, adding an explicit scope improves clarity and prevents potential cache collisions.Suggested fix
- cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=gha,scope=buildkit-linux-amd64 + cache-to: type=gha,mode=max,scope=buildkit-linux-amd64🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/release.yml around lines 52 - 53, The AMD64 job cache entries (cache-from and cache-to) lack an explicit scope; add a unique scope (e.g., scope=buildkit-linux-amd64) to both cache-from and cache-to to mirror the arm64 job's isolation and avoid collisions, updating the cache configuration lines that currently read "cache-from: type=gha" and "cache-to: type=gha,mode=max" to include the scope parameter.
21-21: 💤 Low valueBlacksmith runner labels cause actionlint false positives.
The
blacksmith-2vcpu-ubuntu-2404andblacksmith-2vcpu-ubuntu-2404-armlabels are valid for Blacksmith infrastructure but aren't recognized by actionlint. To suppress these warnings, add an.github/actionlint.yaml:self-hosted-runner: labels: - blacksmith-2vcpu-ubuntu-2404 - blacksmith-2vcpu-ubuntu-2404-arm🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/release.yml at line 21, Add an .github/actionlint.yaml to suppress actionlint warnings for Blacksmith runner labels by declaring the `self-hosted-runner` labels and listing `blacksmith-2vcpu-ubuntu-2404` and `blacksmith-2vcpu-ubuntu-2404-arm`; this will stop actionlint from flagging the `runs-on: blacksmith-2vcpu-ubuntu-2404` (and the ARM variant) in the release.yml workflow.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/release.yml:
- Around line 52-53: The AMD64 job cache entries (cache-from and cache-to) lack
an explicit scope; add a unique scope (e.g., scope=buildkit-linux-amd64) to both
cache-from and cache-to to mirror the arm64 job's isolation and avoid
collisions, updating the cache configuration lines that currently read
"cache-from: type=gha" and "cache-to: type=gha,mode=max" to include the scope
parameter.
- Line 21: Add an .github/actionlint.yaml to suppress actionlint warnings for
Blacksmith runner labels by declaring the `self-hosted-runner` labels and
listing `blacksmith-2vcpu-ubuntu-2404` and `blacksmith-2vcpu-ubuntu-2404-arm`;
this will stop actionlint from flagging the `runs-on:
blacksmith-2vcpu-ubuntu-2404` (and the ARM variant) in the release.yml workflow.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 748148e3-a587-4c2a-a4ba-90441e4291bc
📒 Files selected for processing (4)
.github/workflows/release.yml.github/workflows/tests.yml.golangci.ymlexamples/push-image/main.go
✅ Files skipped from review due to trivial changes (2)
- examples/push-image/main.go
- .golangci.yml
- Add .golangci.yml (v2 format): standard linters + modernize, formatter gofumpt - Add tests.yml: lint/format check and unit tests via Nix on PRs and pushes to main - Add release.yml: build on PRs (VERSION=0.0.0), push to Docker Hub and Huawei SWR on v* tag push; GHA cache enabled with mode=max Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/tests.yml (1)
21-21: 💤 Low valueCustom runner label flagged by actionlint.
The
blacksmith-2vcpu-ubuntu-2404-armlabel is a valid Blacksmith runner, but actionlint doesn't recognize it. Consider adding an.github/actionlint.yamlconfig to declare custom runner labels if you want to silence these warnings:self-hosted-runner: labels: - blacksmith-2vcpu-ubuntu-2404-arm - blacksmith-2vcpu-ubuntu-2404🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/tests.yml at line 21, actionlint is flagging the custom runner label "blacksmith-2vcpu-ubuntu-2404-arm" because it doesn't know custom self-hosted labels; fix by adding an actionlint config file named actionlint.yaml at repo root that defines self-hosted-runner.labels and includes "blacksmith-2vcpu-ubuntu-2404-arm" (and the related "blacksmith-2vcpu-ubuntu-2404") so actionlint recognizes them, or alternatively remove/replace the custom label in the workflow; ensure the config key is exactly self-hosted-runner: labels: [ ... ] and commit it alongside the workflow.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/tests.yml:
- Line 21: actionlint is flagging the custom runner label
"blacksmith-2vcpu-ubuntu-2404-arm" because it doesn't know custom self-hosted
labels; fix by adding an actionlint config file named actionlint.yaml at repo
root that defines self-hosted-runner.labels and includes
"blacksmith-2vcpu-ubuntu-2404-arm" (and the related
"blacksmith-2vcpu-ubuntu-2404") so actionlint recognizes them, or alternatively
remove/replace the custom label in the workflow; ensure the config key is
exactly self-hosted-runner: labels: [ ... ] and commit it alongside the
workflow.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 382b7405-faec-4337-891f-f1bd532d04d9
📒 Files selected for processing (4)
.github/workflows/release.yml.github/workflows/tests.yml.golangci.ymlexamples/push-image/main.go
✅ Files skipped from review due to trivial changes (2)
- .golangci.yml
- examples/push-image/main.go
Summary
.golangci.yml(v2 format):standardlinters +modernize, formattergofumpttests.yml: lint/format check and unit tests via Nix, runs on PRs and pushes tomainrelease.yml: builds on PRs to validate, pushes to Docker Hub and Huawei SWR onv*tag pushTest plan
tests.ymllint and unit jobs pass on this PRrelease.ymlbuild job passes on this PR (no push expected)v*tag and confirm images appear on bothdocker.io/zeabur/stratusandswr.cn-east-3.myhuaweicloud.com/zeabur/stratus🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmithwith what you need.Summary by CodeRabbit